{% extends '../../../layout/admin-base.html' %}
<script src="{{ assets_path("js/base.js")}}"></script>
{% block page %}
<h3 class="page-title">
    宿舍楼信息 <small>列表</small>
</h3>
<ul class="breadcrumb">
    <li>
        <i class="icon-home"></i>
        <a href="index.html">基本信息管理</a> 
        <i class="icon-angle-right"></i>
    </li>
    <li>
        <a href="{{url('admin/user/dorm')}}">宿舍楼信息管理</a>
        <i class="icon-angle-right"></i>
    </li>
    <li><span>列表</span></li>
</ul>
{% end%}
{% block content %}

<div class="row-fluid">
    <div class="span12">
        <div class="portlet box red">
            <div class="portlet-title">
                <div class="caption"><i class="icon-search"></i>搜索条件</div>
                <div class="tools">
                    <a href="javascript:;" class="collapse"></a>
                </div>
            </div>
            <div class="portlet-body form">
                <!-- BEGIN FORM-->
                <form action="{{url('admin/user/dorm/search/')}}" method="post" class="horizontal-form">
                    <div class="row-fluid">
                        <div class="span3">
                            <div class="control-group">
                                <label class="control-label" for="dormName">宿舍楼名</label>
                                <div class="controls">
                                {% try %}
                                    {% if len(ser_list)>0 %}
                                        <input type="text" id="dormName" name="dormName" class="m-wrap span12" value="{{ser_list}}">
                                    {% end %}
                                {% except %}
                                    <input type="text" id="dormName" name="dormName" class="m-wrap span12" placeholder="输入宿舍名">
                                {% end %}
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--/row-->
                    <div class="form-actions">
                        <button type="submit" class="btn blue"><i class="icon-search"></i>搜索</button>
                        <button type="button" class="btn">清空</button>
                    </div>
                </form>
                <!-- END FORM-->
            </div>
        </div>
        <!-- BEGIN EXAMPLE TABLE PORTLET-->
        <div class="portlet box light-grey">
            <div class="portlet-title">
                <div class="caption"><i class="icon-list"></i>宿舍楼列表</div>
                <div class="tools">
                    <a href="javascript:;" class="collapse"></a>
                    <a href="#portlet-config" data-toggle="modal" class="config"></a>
                    <a href="javascript:;" class="reload"></a>
                    <!-- <a href="javascript:;" class="remove"></a> -->
                </div>
            </div>
            <div class="portlet-body">
                <div class="clearfix">
                    <div class="btn-group">
                        <a id="sample_editable_1_new" class="btn green" href="{{url('admin/user/dorm/new')}}">
                        增加<i class="icon-plus"></i>
                        </a>
                    </div>
                    <div class="btn-group pull-right">
                        <button class="btn dropdown-toggle" data-toggle="dropdown">工具<i class="icon-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu pull-right">
                            <li><a href="#">打印</a></li>
                            <li><a href="#">另存为PDF</a></li>
                            <li><a href="#">另存为Excel</a></li>
                        </ul>
                    </div>
                </div>
                <table class="table table-striped table-bordered table-hover" id="sample_1">
                    <thead>
                        <tr>
                            <th style="width:8px;"><input type="checkbox" class="group-checkable" data-set="#sample_1 .checkboxes" /></th>
                            <th>宿舍楼名</th>
                            <th class="hidden-480">备注</th>
                            <th class="hidden-480">创建时间</th>
                            <th ></th>
                        </tr>
                    </thead>
                    <tbody>
                        {% for i in info_list %}
                        <tr class="odd gradeX">
                            <input type="hidden" value="{{i['Fid']}}">
                            <td><input type="checkbox" class="checkboxes" value="1" /></td>
                            <td>{{i['Fdorm_name']}}</td>
                            <td class="span6">{{i['Fremark']}}</td>
                            <td class="hidden-100">{{stamp_2_time(i['Fcreate_time'])}}</td>
                            <td ><a class="btn mini purple" href="{{url('admin/user/dorm/edit/?dormId='+i['Fid'])}}"><i class="icon-edit"></i>编辑</a>
                                <a class="btn mini black" role="button" data-toggle="modal" href="{{url('admin/user/dorm/del/?dormId='+i['Fid'])}}" ><i class="icon-trash"></i>删除</a>
                            </td>
                        </tr>
                        {% end %}

                    </tbody>
                </table>
                {% module Paginate(page_info['total'], page_info['page']) %}
            </div>
        </div>
        <!-- END EXAMPLE TABLE PORTLET-->
    </div>
    <div id="delModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="mydelModal" aria-hidden="true">
        <div class="modal-header">
            <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
            <h3 id="mydelModal">删除</h3>
        </div>
        <div class="modal-body">
            <p>确认删除？</p>
        </div>
        <div class="modal-footer">
            <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
            <button id="confirm" data-dismiss="modal" class="btn blue">确认</button>
        </div>
    </div>
</div>

<script language="javascript">
   function edit(fid) {
        $('#delModal').modal({
            show:true
        }).on("shown.bs.modal", function () {
            console.log("show"+fid);
            // $('#confirm').click(function(){
            //     console.log("show"+id);
            //     console.log(id);
            // })
        }).on("hidden.bs.modal", function () {
            $(this).removeData("bs.modal");
        });
    }
</script>

{% end%}